const express = require('express');
const app = express();
const path = require('path')
app.listen(3000,()=>{console.log('已开启服务器');});
const myquery = require('./封装');
app.get('/',(req,res)=>{
    res.sendFile(path.join(__dirname,'商品信息.html'))
})
app.get('/index', async (req,res)=>{
    let sql = `select * from trade`;
    let[err,result] = await myquery(sql)
    res.send(result)
})